package cn.lingnan.controller;

import cn.lingnan.dao.GoodsDao;
import cn.lingnan.entity.goods.Goods;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("goods")
public class GoodsController {
    @Autowired
    private GoodsDao goodsdao;


    @GetMapping("findAll")
    @ResponseBody
    public List<Goods> queryAll(){
        List<Goods> goodsList = goodsdao.findAllGoods();
        System.out.println(goodsList.get(1).getGoods_name());
        return goodsList;
    }

}
